<html>
<head><meta charset="utf-8"><title>Need implementing ABI code for m68k · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html">Need implementing ABI code for m68k</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="201951574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201951574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Paul Adrian Glaubitz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201951574">(Jun 25 2020 at 10:14)</a>:</h4>
<p>Hi!</p>
<p>I'm working on porting Rust to m68k using a work-in-progress version of LLVM for m68k.</p>
<p>I have most basic pieces on the Rust side done, but I need help with the ABI code, see: <a href="https://github.com/rust-lang/rust/issues/73685">https://github.com/rust-lang/rust/issues/73685</a></p>
<p>Would one the compiler experts be willing to help me write the ABI part, i.e. the function "compute_abi_info"?</p>
<p>Thanks!</p>



<a name="201952156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201952156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201952156">(Jun 25 2020 at 10:23)</a>:</h4>
<p>I tried looking at <a href="https://github.com/M680x0/M680x0-mono-repo">https://github.com/M680x0/M680x0-mono-repo</a>, but I can't find the clang equivalent of compute_abi_info for M680x0. I can find it for other target isa's though.</p>



<a name="201953221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201953221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Paul Adrian Glaubitz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201953221">(Jun 25 2020 at 10:40)</a>:</h4>
<p>Right, I guess we're still missing that part. Even though it already compiles usable C code.</p>



<a name="201953268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201953268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201953268">(Jun 25 2020 at 10:41)</a>:</h4>
<p>Do you know where gcc defines it? I could take a look at that version.</p>



<a name="201953275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201953275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201953275">(Jun 25 2020 at 10:41)</a>:</h4>
<p>Have you looked at what AVR does? IIRC it also uses some default implementation here</p>



<a name="201953307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201953307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Paul Adrian Glaubitz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201953307">(Jun 25 2020 at 10:41)</a>:</h4>
<p>I'll ask one of the GCC guys at my company (SUSE). Just a second.</p>



<a name="201953488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201953488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Paul Adrian Glaubitz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201953488">(Jun 25 2020 at 10:44)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> I think m68k would need special code as it makes a difference between address and data registers.</p>



<a name="201954469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201954469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Paul Adrian Glaubitz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201954469">(Jun 25 2020 at 10:56)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> <a href="https://github.com/gcc-mirror/gcc/blob/master/gcc/config/m68k/m68k.c#L1443">https://github.com/gcc-mirror/gcc/blob/master/gcc/config/m68k/m68k.c#L1443</a></p>



<a name="201955420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201955420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201955420">(Jun 25 2020 at 11:07)</a>:</h4>
<blockquote>
<p>/* On the m68k all args are always pushed.  */</p>
</blockquote>
<p><span class="user-mention" data-user-id="315453">@John Paul Adrian Glaubitz</span> I am not completely sure but I think all aggregate args should be marked <code>byval</code> using <code>arg.make_indirect_byval()</code> instead of using <code>arg.cast_to(Uniform { ... })</code>.</p>



<a name="201955677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201955677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Paul Adrian Glaubitz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201955677">(Jun 25 2020 at 11:11)</a>:</h4>
<p>ok</p>



<a name="201955741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201955741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201955741">(Jun 25 2020 at 11:12)</a>:</h4>
<p>I do advice you to add some codegen tests to test for compatibility with gcc.</p>



<a name="201955788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201955788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Paul Adrian Glaubitz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201955788">(Jun 25 2020 at 11:13)</a>:</h4>
<p>Will do.</p>



<a name="201956048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201956048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201956048">(Jun 25 2020 at 11:16)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/tree/9ebf47851a357faa4cd97f4b1dc7835f6376e639/src/test/run-make-fulldeps/extern-fn-struct-passing-abi">https://github.com/rust-lang/rust/tree/9ebf47851a357faa4cd97f4b1dc7835f6376e639/src/test/run-make-fulldeps/extern-fn-struct-passing-abi</a> seems to be pretty much the kind of test you need.</p>



<a name="201956196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201956196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Paul Adrian Glaubitz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201956196">(Jun 25 2020 at 11:19)</a>:</h4>
<p>OK, thanks!</p>



<a name="201956285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Need%20implementing%20ABI%20code%20for%20m68k/near/201956285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Paul Adrian Glaubitz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Need.20implementing.20ABI.20code.20for.20m68k.html#201956285">(Jun 25 2020 at 11:20)</a>:</h4>
<p>Guess we also need to something similar when returning a struct.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>